{% extends "template.html" %}

{% block page_content %}
<div class="page-header">
    <h3 align="center" style="margin-top: 66px">Server List&ensp;&ensp;(total {{ ip|count }} servers)</h3>
    <table width="99%" border="1" cellspacing="0" cellpadding="6" align="center" id="monitor">
        <tr style="align: center; margin: auto; background-color: #99CCFF">
            <th width=13% style="text-align: center;">Server</th>
            <th width=35% style="text-align: center;">System Version</th>
            <th width=13% style="text-align: center;">CPU/Usage</th>
            <th width=14% style="text-align: center;">Memory/Usage</th>
            <th width=13% style="text-align: center;">Disk/Usage</th>
            <th width=12% style="text-align: center;">Bandwidth</th>
        </tr>
        {% for host in ip %}
            <tr align="center">
                <td><a href="http://{{ ip[loop.index0] }}:{{ port[loop.index0] }}">{{ ip[loop.index0] }}</a></td>
                <td>{{ system[loop.index0] }}</td>
                {% if cpu_usage[loop.index0] < max_cpu %}
                    <td>{{ cpu[loop.index0] }} cores/{{ cpu_usage[loop.index0]|round(2) }}%</td>
                {% else %}
                    <td><strong style="font-weight: bold; color: #ff3333">{{ cpu[loop.index0] }} cores/{{ cpu_usage[loop.index0]|round(2) }}%</strong></td>
                {% endif %}
                {% if mem_usage[loop.index0] < max_mem %}
                    <td>{{ mem[loop.index0] }}G/{{ mem_usage[loop.index0]|round(2) }}%</td>
                {% else %}
                    <td><strong style="font-weight: bold; color: #ff3333">{{ mem[loop.index0] }}G/{{ mem_usage[loop.index0]|round(2) }}%</strong></td>
                {% endif %}
                {% if disk_usage[loop.index0] < max_disk %}
                    <td>{{ disk[loop.index0] }}/{{ disk_usage[loop.index0]|round(2) }}%</td>
                {% else %}
                    <td><strong style="font-weight: bold; color: #ff3333">{{ disk[loop.index0] }}/{{ disk_usage[loop.index0]|round(2) }}%</strong></td>
                {% endif %}
                {% if net[loop.index0] == 1 %}
                    <td>None</td>
                {% else %}
                    <td>{{ net[loop.index0] }}Mb/s</td>
                {% endif %}
            </tr>
        {% endfor %}
    </table>
</div>
{% endblock %}
